<!DOCTYPE html>
<html lang="en" xmlns:C="http://java.sun.com/jsp/jstl/core" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <script src=""></script>
    <title>增加</title>
</head>

<body>
<div class="ibox-title">
    <form class="form-horizontal m-t" id="commentForm" novalidate="novalidate" action="/updateProduct">
        <div class="form-group">
            <div class="col-sm-8">
                <input id="product_id" name="product_id" minlength="2" type="hidden" class="form-control" required=""
                       aria-required="true" th:value="${productView.product_id}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">产品名：</label>
            <div class="col-sm-8">
                <input id="product_name" name="product_name" minlength="2" type="text" class="form-control" required=""
                       aria-required="true" th:value="${productView.product_name}">
            </div>
        </div>
        <!-- 品牌 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">品牌：</label>
            <div class="col-sm-8">
                <select id="brandSelect" name="brand_name" class="form-control">
                    <option th:text="${productView.brand_name}"></option>
                    <option th:each="brand:${brands}"
                            th:value="${brand.brand_name}"
                            th:text="${brand.brand_name}"
                    ></option>
                </select>
            </div>
        </div>

        <!-- 类型 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">类型：</label>
            <div class="col-sm-8">
                <select id="typeSelect" name="type_name" class="form-control">
                    <option th:text="${productView.type_name}"></option>
                    <option th:each="type:${types}"
                            th:value="${type.type_name}"
                            th:text="${type.type_name}"
                    ></option>
                </select>
            </div>
        </div>

        <!-- 产地 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">产地：</label>
            <div class="col-sm-8">
                <select id="placeSelect" name="place_name" class="form-control">
                    <option th:text="${productView.place_name}"></option>
                    <option th:each="place:${places}"
                            th:value="${place.place_name}"
                            th:text="${place.place_name}"
                    ></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">供应商：</label>
            <div class="col-sm-8">
                <select id="supplySelect" name="supply_name" class="form-control">
                    <option th:text="${productView.supply_name}"></option>
                    <option th:each="supply:${supplyList}"
                            th:value="${supply.supply_name}"
                            th:text="${supply.supply_name}"
                    ></option>
                </select>
            </div>
        </div>

        <!-- 仓库 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">仓库：</label>
            <div class="col-sm-8">
                <select id="storeSelect" name="store_name" class="form-control">
                    <option th:text="${productView.store_name}"></option>
                    <option th:each="store : ${stores}"
                            th:value="${store.store_name}"
                            th:text="${store.store_name}"></option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">数量：</label>
            <div class="col-sm-8">
                <input id="product_num" name="product_num" class="form-control" required=""
                       aria-required="true" th:value="${productView.product_num}">
            </div>
        </div>
        <!-- 单位 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">单位：</label>
            <div class="col-sm-8">
                <select id="unitSelect" name="unit_name" class="form-control" >
                    <option th:text="${productView.unit_name}"></option>
                    <option th:each="unit : ${units}"
                            th:value="${unit.unit_name}"
                            th:text="${unit.unit_name}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">介绍：</label>
            <div class="col-sm-8">
                <input id="introduce" name="introduce" class="form-control" required=""
                       aria-required="true" th:value="${productView.introduce}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">进价：</label>
            <div class="col-sm-8">
                <input id="in_price" name="in_price" type="number" class="form-control" required=""
                       aria-required="true" step="0.01" min="0" th:value="${productView.in_price}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">售价：</label>
            <div class="col-sm-8">
                <input id="sale_price" name="sale_price" type="number" class="form-control" required=""
                       aria-required="true" step="0.01" min="0" th:value="${productView.sale_price}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">上下架：</label>
            <div class="col-sm-8">
                <div class="row">
                    <div class="col-sm-9">
                        <select class="form-control" style="height: 34px;" required="">
                            <option value="1">上架</option>
                            <option value="0">下架</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-3">
                <button class="btn btn-primary" type="submit">提交</button>
            </div>
        </div>
    </form>

</div>


</body>
<script>
    window.onload = function() {
        // 获取下拉框元素
        var brandSelect = document.getElementById("brandSelect");

        // 打印下拉框的值
        console.log(brandSelect);
    }
</script>
</html>